<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<div class="body" style="position: relative">
    <div style="position: absolute;left: 20px;top:10px ; width: 70px; text-align: center;color: #47a6f5;cursor:pointer;border: 1px solid  #47a6f5;line-height: 28px"
         onclick="manage_sys_opens('中心机房','/manage/demo/powerPage/tosecondaryPages.html')">返回</div>
<div class="container"><div class="EMStop1"></div></div>
<div class="container1">
    <div class="EMSUspContent"><p class="EMStitle" style="position: absolute;top:40px ;position: relative">新风系统监控</p>
        <div class="content">
            <div class="left">
                <div class="upsSd" style=" background-image: url('/manage/assert/image/xinfeng.gif');">
                    <div class="loading" id="box">

                    </div>
                </div>
                <p>开机状态 :<span class="linkSuccess" id="switchingstate"></span></p>
            </div>
            <div style="height: 300px;">
                <div class="right" style="height: 70px;margin-top: 115px">
                <table id="freshAir_table" border="2">
                    <tr>
                        <th class="blueBg">工作模式</th>
                        <td ><span name="workingmode"></span></td>
                        <th class="blueBg">PM2.5浓度</th>
                        <td><span name="pm25"></span></td>

                    </tr>
                    <tr>
                        <th class="blueBg">风速</th>
                        <td><span name="windspeed"></span></td>
                        <th class="blueBg">PM10浓度</th>
                        <td><span name="pm10"></span></td>

                    </tr>
                    <tr>
                        <th class="blueBg">温度</th>
                        <td><span name="temperature"></span></td>
                        <th class="blueBg">湿度</th>
                        <td><span name="humidity"></span></td>
                    </tr>


                </table>
            </div>
            </div>
        </div>
    </div>
</div>

</div>
<script>
    $(function () {
        var count = 0;
        var t = setInterval(function () {
            var $redDiv = $("#box").find(".greenBg");
            if(count === 15){
                count=-1;
                $("#box").find('.greenBg').removeClass('greenBg').addClass('white');
                $redDiv=$("#box").find(".first");
                $("#box").find(".last").removeClass("greenBg").addClass("white");
            }
            $redDiv.next().removeClass("white").addClass("greenBg");
            count++;
        }, 1000);
        //if($.websocket.socketMsgs) {
        $.post("/manage/demo/equipment/fetchLastData.html?eids="+ $.websocket.xfxt,function (entity) {

        })
           /* var entity = $.websocket.xfxtall
           // var entity = JSON.parse(socketMsg.entity)
            if (entity.equipmentid == $.websocket.xfxt) {//新风系统监控
                $("#freshAir_table span[name='pm10']").text(entity.pm10);
                $("#freshAir_table span[name='pm25']").text(entity.pm25);
                $("#freshAir_table span[name='switchingstate']").text(entity.switchingstate);
                if(entity.workingmode==1){
                    $("#freshAir_table span[name='workingmode']").text("手动");
                }else if(entity.workingmode==2) {
                    $("#freshAir_table span[name='workingmode']").text("自动");
                }else{
                    $("#freshAir_table span[name='workingmode']").text("定时");
                }

                //$("#freshAir_table span[name='windspeed']").text(entity.windspeed);
                $("#freshAir_table span[name='temperature']").text(entity.temperature);
                $("#freshAir_table span[name='humidity']").text(entity.humidity);
                $("#freshAir_table span[name='filtertime']").text(entity.filtertime);
                if(entity.windspeed=='1'){
                    $("#freshAir_table span[name='windspeed']").text('低档');
                }else if(entity.windspeed=='2') {
                    $("#freshAir_table span[name='windspeed']").text('中档');
                }else if(entity.windspeed=='3') {
                    $("#freshAir_table span[name='windspeed']").text('高速');
                }else if(entity.windspeed=='0') {
                    $("#freshAir_table span[name='windspeed']").text('停止');
                }
            }*/
        //}

    });
</script>